FROM 192.168.43.144:8098/centos/centos:centos7
#FROM registry.cn-hangzhou.aliyuncs.com/luwanjia/centos:centos7
#FROM centos:centos7
EXPOSE 80

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN yum -y install pcre-devel openssl-devel net-tools gcc gcc-c++ zlib zlib-devel \
    make openssl
#ADD http://nginx.org/download/nginx-1.17.10.tar.gz /tmp/
ADD ./nginx-1.17.10.tar.gz /tmp/
ADD ./nginx-upstream-dynamic-servers.tar.gz /tmp/
ADD ./ngx_upstream_jdomain.tar.gz /tmp/
WORKDIR  /tmp
#RUN tar -zxvf nginx-1.17.10.tar.gz
RUN cd /tmp/nginx-1.17.10 \
    && ./configure --prefix=/usr/local/nginx \
     --with-http_ssl_module \
     --with-http_gzip_static_module \
     --with-http_realip_module \
	 --add-module=../ngx_upstream_jdomain \
     --add-module=../nginx-upstream-dynamic-servers \
    && make && make install
RUN mkdir -p /usr/local/nginx/logs \
    && groupadd -g 1001 nginx \
    && useradd -g 1001 -u 1001 -s /sbin/nologin -M nginx

ADD webapps /opt/webapps
#VOLUME /user/local/nginx/logs
#VOLUME /user/local/nginx/conf/nginx.conf
ADD ./conf/nginx.conf /usr/local/nginx/conf/nginx.conf
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
